<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>

<c:if test="${empty USER}">
    <jsp:forward page="login.html"/>
</c:if>

<jsp:include page="header.jsp"/>
<!-- Check neu ko dang nhap ma vao truc tiep vao-->
<a id="totop" class="bgcolor" title="back to top" href="#top-page">
    <img title="" alt="top" src="img/backtop.gif"/> Về đầu trang
</a>
<div id="content">
    <div class="container san-serif-font">
        <div class="left-menu">
            <h3>Feed đang hot</h3>
            <c:import url="WEB-INF/dataXML/feed.xml" var="feedXML" charEncoding="UTF-8" />
            <c:import url="WEB-INF/xsl/hotFeed.xsl" var="hotfeedXSL" charEncoding="UTF-8"/>
            <x:transform xml="${feedXML}" xslt="${hotfeedXSL}">
                <x:param name="userId" value="${USER.userId}"/>
            </x:transform>
            <h3>Feed mới</h3>

            <c:import url="WEB-INF/xsl/newFeed.xsl" var="newfeedXSL" charEncoding="UTF-8"/>
            <x:transform xml="${feedXML}" xslt="${newfeedXSL}">
                <x:param name="userId" value="${USER.userId}"/>
            </x:transform>
            <h2><a href="getFeedList.action">Danh sách các feed</a></h2>
            <h2><a href="newFeed.action">Thêm feed mới</a></h2>
        </div>
        <div class="right-content">
            <div>
                <h4>Danh sách feed của bạn</h4>
                <!-- User rss list begin here -->

                <c:import charEncoding="UTF-8" url="/WEB-INF/xsl/feedToUserList.xsl" var="userListXSL"/>
                <x:transform xml="${feedXML}" xslt="${userListXSL}">
                    <x:param name="userID" value="${USER.userId}"/>
                </x:transform>
                <!-- User rss list end here -->

                <c:if test="${not empty outputXML}">
                    <div class="entryList">
                        <!-- FeedList list begin here -->
                        <h4><s:property value="rssName"/></h4>
                        <c:import charEncoding="UTF-8" url="${outputXML}" var="singleFeedXML"/>
                        <c:import charEncoding="UTF-8" url="WEB-INF/xsl/rssSecondPass.xsl" var="passXSL"/>
                        <x:transform xml="${singleFeedXML}" xslt="${passXSL}"/>
                        <!-- FeedList list end here -->
                    </div>

                </c:if>

            </div>
        </div>
    </div>
    <div class="clearfix"></div>

    <script type="text/javascript" src="js/jsUtils.js"></script>
<script type="text/javascript">
    activeCurrentNav('homeNav');
</script>


    <jsp:include page="footer.jsp"/>